home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / Software / Vyzkuste / xsetup / _SETUP.2 / Group3 / XQ FileEx Hide 2.xpl < prev    next >
Text File  |  1999-10-22  |  3KB  |  93 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 3.1"
  2. "TYPE"="6"
  3. "COUNT"="1"
  4. "UIPATH"="Appearance\Explorer\Hide File Extension"
  5. "NAME"="Display Extensions #2"
  6. "VERSION"="1.14"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="Display extension for scrap files (*.SHS)"
  9. "TEXT 2"="Display extension for command mode settings (*.PIF)"
  10. "TEXT 3"="Display extension for internet shortcuts (*.URL)"
  11. "TEXT 4"="Display extension for quickbar links (*.SCF)"
  12. "TEXT 5"="Display extension for task scheduler files (*.JOB)"
  13. "DESCRIPTION 1"="This plug-in can be used to hide or show the extensions for some files. For example a file called "XTEQ.URL" would appear as "XTEQ" if you disable the display of the extension."
  14. "AUTHOR"="Xteq Systems"
  15. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  16. "COMMENT 1"="For more information, go to http://www.xteq.com or write to TeXHeX@gmx.net."
  17. "COMMENT 2"="Thanks to CptSiskoX for his help!"
  18.  
  19.  
  20. '******************************************************************
  21. '***                MASTER TEMPLATE                            ****
  22. '******************************************************************
  23. sVals=Array(".shs")
  24. '******************************************************************
  25. '*** Keep an eye on the order (must be the same as "TEXT x") ! ****
  26. '******************************************************************
  27. sPath="HKCR\"
  28. sValue="\NeverShowExt"
  29. sValue2="\@"
  30.  
  31.  
  32. SUB Plugin_Initialize
  33.  for i=0 to UBound(sVals)
  34.      Call ReadIt(i+1,sVals(i)) 
  35.  next 
  36. END SUB
  37.  
  38. Sub ReadIt(ITM,VAL)
  39.  s=GetRealPath(VAL)
  40.  s=RegReadValue(sPath & s & sValue)
  41.  if IsEmpty(s)=true then
  42.     Call SetUIElement(ITM,true)
  43.  else
  44.     Call SetUIElement(ITM,false)
  45.  end if
  46.      
  47. End Sub
  48.  
  49. Function GetRealPath(VAL)
  50.  GetRealPath=RegReadValue(sPath & VAL & sValue2)
  51. End Function
  52.  
  53.  
  54. 'Called when the Plugin should validate the Data the user has entered
  55. SUB Plugin_CheckData(ElementIndex)
  56. END SUB
  57.  
  58. 'Called when the Plugin should apply the changes
  59. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  60.  for i=0 to UBound(sVals)
  61.      Call WriteIt(i+1,sVals(i)) 
  62.  next 
  63.  
  64.  Call Restart()
  65. END SUB
  66.  
  67. Sub WriteIt(ITM,VAL)
  68.  sR=GetRealPath(VAL)
  69.  b=GetUIElement(ITM)
  70.  
  71.  if b=true then
  72.  
  73.     'Display it
  74.     s=RegReadValue(sPath & sR & sVALUE)
  75.     if IsEmpty(s)=false then
  76.        Call RegDeleteValue(sPath & sR & sVALUE)
  77.     end if
  78.  
  79.  else
  80.  
  81.    'Hide it   
  82.    Call RegWriteValue(sPath & sR & sVALUE,"",1) 
  83.  
  84.  end if   
  85. End Sub
  86.  
  87.  
  88. 'Called when the Plugin is about to be removed from memory
  89. SUB Plugin_Terminate
  90. END SUB
  91.  
  92.  
  93.